# -*- coding: utf-8 -*-
# frontend/config/settings.py
import os
from typing import Dict, List

# 定义支持的模型
SUPPORTED_MODELS = {
    "GPT-4": {
        "provider": "OpenAI",
        "description": "OpenAI最强大的模型，擅长复杂任务",
        "max_tokens": 8192,
        "temperature": 0.7,
        "color": "#FF6B6B",
        "avatar": "🧠",
        "default": True
    },
    "文心一言": {
        "provider": "百度",
        "description": "百度的大语言模型",
        "max_tokens": 2000,
        "temperature": 0.8,
        "color": "#4ECDC4",
        "avatar": "🐼",
        "default": False
    },
    "通义千问": {
        "provider": "阿里云",
        "description": "阿里云的大语言模型",
        "max_tokens": 2500,
        "temperature": 0.6,
        "color": "#45B7D1",
        "avatar": "🌐",
        "default": False
    },
    "Claude": {
        "provider": "Anthropic",
        "description": "Anthropic的大语言模型",
        "max_tokens": 100000,
        "temperature": 0.7,
        "color": "#96CEB4",
        "avatar": "🎭",
        "default": False
    },
    "豆包": {
        "provider": "字节跳动",
        "description": "字节跳动的大语言模型",
        "max_tokens": 4000,
        "temperature": 0.7,
        "color": "#FFAD60",
        "avatar": "🌱",
        "default": False
    }
}

class Settings:
    # API配置
    API_BASE_URL = os.getenv("API_BASE_URL", "http://localhost:8080")
    API_TIMEOUT = int(os.getenv("API_TIMEOUT", "30"))
    
    # 模型配置
    AVAILABLE_MODELS = list(SUPPORTED_MODELS.keys())
    
    # UI配置
    PAGE_TITLE = "🤖 智能模型群聊系统"
    PAGE_ICON = "🤖"
    LAYOUT = "wide"
    
    # 主题配置
    PRIMARY_COLOR = "#165DFF"
    SECONDARY_COLOR = "#7B61FF"
    SUCCESS_COLOR = "#00B42A"
    WARNING_COLOR = "#FF7D00"
    DANGER_COLOR = "#F53F3F"
    
    # 消息配置
    MAX_MESSAGE_LENGTH = 4000
    MAX_MESSAGES_PER_SESSION = 100
    MESSAGE_RETENTION_DAYS = 30
    
    @classmethod
    def get_model_config(cls, model_name: str) -> Dict:
        """获取模型配置"""
        return SUPPORTED_MODELS.get(model_name, {})